<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<script th:src="@{/js/jquery.min.js}"></script>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>登录界面</title>
</head>
<h3 th:text="'sesssionId:' + ${session.sessionId}"></h3>
<body>
<div align="center">
    <h1 style="color:red">登录</h1>
    <form id="indexform" name="indexForm" method="post">
        <table border="0">
            <tr>
                <td>账号：</td>
                <td><input type="text" name="username" id="username" required=”required”></td>
            </tr>
            <tr>
                <td>密码：</td>
                <td><input type="password" name="password" id="password" required=”required”>
                </td>
            </tr>
        </table>
        <br>
        <input type="button" value="登录" style="color:#BC8F8F" onclick="login()">
    </form>
</div>
</body>
</html>

<script type="text/javascript">


    function login() {
        var data = {};
        data["username"] = $("#username").val();
        data["password"] = $("#password").val();
        console.info($("#username").val());
        console.info(13344);
        jQuery.ajax({
            url: "/cluster-session/test/loginVerify",
            data: JSON.stringify(data),
            type: "POST",
            dataType: "json",
            contentType: "application/json;charset=utf-8",
            success: function (data) {
                if (data.status != '0000') {
                    alert("用户名或者密码输错");
                } else {
                    window.location.href = "/cluster-session/test/queryAllResume";
                }
            }
        });
    }
</script>

